package com.lvs.zmwz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lvs.zmwz.comm.DictionaryEnum;
import com.lvs.zmwz.entity.Pinglun;
import com.lvs.zmwz.entity.SysManager;
import com.lvs.zmwz.mapper.PinglunMapper;
import com.lvs.zmwz.service.IPinglunService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lvs.zmwz.util.QPage;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2022-07-21
 */
@Service
public class PinglunServiceImpl extends ServiceImpl<PinglunMapper, Pinglun> implements IPinglunService {

    /**
     * 评论列表
     * @param qPage
     * @param sysManagerSearch
     * @return
     */
    @Override
    public IPage<Pinglun> getListAll(QPage qPage, Pinglun sysManagerSearch) {
        QueryWrapper<Pinglun> queryWrapper=new QueryWrapper<>();
        queryWrapper.lambda().like(StringUtils.isNotEmpty(sysManagerSearch.getContent()),Pinglun::getContent,sysManagerSearch.getContent());
        queryWrapper.orderByDesc("ctime");
        IPage<Pinglun> hjManagerIPage=this.page(new Page<>(qPage.getOffset(), qPage.getLimit()),queryWrapper);
        return hjManagerIPage;
    }


}
